package com.epfly.iface.promo.activity.enums;


import java.util.HashMap;
import java.util.Map;

/**
 * 优惠方式:1.满减;2.折扣;5.菜品分类折扣;6.菜品折扣;7.特价菜;
 */
public enum DiscountTypeEnum {

    /**
     * 1.满减;
     */
    ORDER_FULL((byte) 1, "满减"),
    /**
     * 2.折扣;
     */
    ORDER_REBATE((byte) 2, "折扣"),
    /**
     * 5.菜品分类折扣;
     */
    FOOD_CATEGORY_REBATE((byte) 5, "菜品分类折扣"),
    /**
     * 6.菜品折扣;
     */
    FOOD_REBATE((byte) 6, "菜品折扣"),
    /**
     * 7.特价菜;
     */
    FOOD_BARGAIN((byte) 7, "特价菜");


    private static Map<Byte, DiscountTypeEnum> loopUp = new HashMap<>();

    static {
        for (DiscountTypeEnum value : values()) {
            loopUp.put(value.getKey(), value);
        }
    }

    public static String getValue(Byte key) {
        return loopUp.get(key).getValue();
    }

    private  Byte key;

    private String value;


    DiscountTypeEnum(Byte key) {
        this.key = key;
    }

    DiscountTypeEnum(Byte key, String value) {
        this.key = key;
        this.value = value;
    }

    public Byte getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
